#include "Mesh.h"
#include <OpenVolMesh/Core/IO/MeshIO.hh>
#include "../CmdLine/CmdLine.h"
#include "FnTagging.h"


void usage()
{
  printf("usage: rearrange.exe \n");
}


int main(int argc, char* argv[])
{
  CCmdLine      cmdLine;
  std::string   in_filename, tag_filename, avm_filename;

  if (cmdLine.SplitLine(argc, argv) < 1)
  {
     // no switches were given on the command line, abort
     assert(0);
     exit(-1);
  }

  /// check the required options
  if (!cmdLine.HasSwitch("-in") ||
      !cmdLine.HasSwitch("-tag") || !cmdLine.HasSwitch("-avm"))       
  {
    std::cerr << "Usage: tagging -in <input.avm> -tag <output1.tag> -avm <output2.avm>..." << std::endl;
    return  0;
  }
  // read I/O options
  in_filename = cmdLine.GetArgument("-in", 0);
  tag_filename = cmdLine.GetArgument("-tag", 0);
  avm_filename = cmdLine.GetArgument("-avm", 0);

  Mesh                    mesh;
  
  // loading an input mesh
  OpenVolMesh::IO::read_mesh(mesh, in_filename);

  FnTagging fntagging(mesh);

  fntagging.tagging(tag_filename, avm_filename);

	return 0;
}

